#include <bits/stdc++.h>
#define int long long 
using namespace std;

const int maxn = 1005;
int x[maxn], y[maxn];
int vis[maxn];

double dis(int cur, int i){
	return sqrt((x[cur]-x[i])*(x[cur]-x[i]) + (y[cur]-y[i])*(y[cur]-y[i]));
}


void solve(){
	int n, d;
	cin >> n;
	for (int i=1;i<=n;i++) {
		cin >> x[i] >> y[i];
	}
	cin >> d;
	queue<int> q;
	vis[1] = 1; // 第一个被感染
	q.push(1);
	// BFS
	while(!q.empty()){
		int cur = q.front();
		q.pop();
		for (int i=1;i<=n;i++) {
			if (vis[i]) {
				continue;
			} else {
				if (dis(cur, i) <= d) {
					vis[i] = 1;
					q.push(i);
				}
			}
		}
	}
	for (int i=1;i<=n;i++) {
		if (vis[i]) {
			cout << 1 << '\n';
		} else {
			cout << 0 << '\n';			
		}
	}
	
}

signed main(){
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	solve();
	return 0;
}

